<template>
  <div class="home">
    <home-header></home-header>
    <home-swiper :swiperList="swiperList"></home-swiper>
  </div>
</template>

<script>
// @ is an alias to /src
import HomeHeader from './components/HomeHeader'
import HomeSwiper from './components/HomeSwiper'
import axios from 'axios'
export default {
  name: 'home',
  components: {
    HomeHeader,
    HomeSwiper
  },
  data() {
    return {
      swiperList: []
    }
  },
  methods: {
    getHomeInfo() {
      axios.get('/api/index.json').then(this.getHomeInfoSuccess)
    },
    getHomeInfoSuccess(res) {
      this.swiperList = res.data.data.swiperList
    }
  },
  mounted() {
    this.getHomeInfo()
  }
}
</script>
